home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15082 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Return type - array of structures - please help!
  5. Date: 16 Apr 1996 15:53:14 -0700
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4l18cqINNfmj@keats.ugrad.cs.ubc.ca>
  8. References: <4l0c9g$tsr@thorn.cc.usm.edu>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <4l0c9g$tsr@thorn.cc.usm.edu>,
  12. Michael Kirgan <mkirgan@pacific.st.usm.edu> wrote:
  13. >I wish to make the function called delete to return an array of 
  14. >structures or if that is not possible at least create it so when
  15.  
  16. It is not possible.
  17.  
  18. >I pass an array of structures, it is by reference and not value like 
  19. >listed below.
  20. >
  21. >Here is an expample of my code:
  22. >
  23. >typdef struct
  24. > {
  25. >  char ssn[12];
  26. >  char lastname[15];
  27. >  char firstname[15];
  28. >  char data[10];
  29. > } student;
  30. >
  31. >void delete(char [], class [])
  32.  
  33. This function header is illegal. The ``char []'' lacks a parameter declarator
  34. name. It should be something like ``char string[]'' or something like that.
  35. Secondly, the ``class'' identifier is not even declared. Are you using some
  36. weird pre-processing tricks to make the above work? Such as,
  37.  
  38.     #define char char A
  39.     #define class char B
  40.  
  41. >The above code works, but it passes by value, so changes are not passed back.
  42.  
  43. Are you kidding? How can it work when it's not even valid C! It won't compile
  44. in any C environment that I have ever used. Are you sure you have the right
  45. newsgroup?
  46.  
  47. Please rewrite your program in C, try your best to get it to compile with a C
  48. language compiler to eliminate as many errors and warnings as you can, and then
  49. ask again.
  50. -- 
  51. I'm not really a jerk, but I play one on Usenet.
  52.